package com.lin.cloud.disk.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lin.cloud.disk.entity.dto.LogicDeleteStatusDTO;
import com.lin.cloud.disk.entity.pojo.CompanyDepartment;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (CompanyDepartment)表数据库访问层
 *
 * @author ljc
 * @since 2021-01-13 18:29:29
 */
@Repository
public interface CompanyDepartmentMapper extends BaseMapper<CompanyDepartment> {


    /**
     * 获取部门ID列表 通过公司
     * @param companyId
     * @return
     */
    List<Long> getDepartmentIdListByCompany(@Param("companyId") Long companyId);

    /**
     * 删除公司部门
     * @param deleteStatusDTO
     * @return
     */
    Integer logicDeleteOrRecover(LogicDeleteStatusDTO deleteStatusDTO);

    /**
     * 更新公司部门关联表信息
     * @param companyDepartment
     */
    void updateCompanyDepartment(CompanyDepartment companyDepartment);

    /**
     * 通过公司ID与部门Id查询
     * @param companyId
     * @param departmentId
     * @return
     */
    CompanyDepartment selectByCompanyIdAndDepartmentId(Long companyId, Long departmentId);
}